<?php

/**
 * Classe da interface formulario frmMain
 */
abstract class IfrmMain {
	/**
	 * Armazena os widgets necessarios
	 * 
	 * @var array
	 */
	public $widgets = array();
	
	/**
	 * Construtor da classe
	 */
	public function __construct() {
		// Cria a janela
		$this->widgets['frmMain'] = new GtkWindow();
		$box = new GtkVBox();
		
		// Cria o status icon
		$this->widgets['stiMain'] = new GtkStatusIcon();
		$this->widgets['stiMain']->set_from_file(APPLICATION_PATH . "/images/logo.png");
		$this->widgets['stiMain']->set_tooltip_text("pTray"); 
		
		// Cria o menu principal
		$this->widgets['mnuMain'] = Fabula::GtkMenu();
		
		// Inicia a aplicação
		$this->widgets['frmMain']->add($box);
		$this->_signals();
		$this->frmMain_onload();
	}
	
	/**
	 * Conecta os sinais dos widgets
	 *
	 * @access private
	 */
	private function _signals() {
		$this->widgets['stiMain']->connect("popup-menu", array($this, "stiMain_onpopup"));
		$this->widgets['frmMain']->connect("destroy", array($this, "frmMain_unload"));
	}
}
